import request from "@/utils/request"; // axios请求

import type { ILoginData, IUserInfo, ILoginParams } from "./model/index"; // 类型接口

// 请求地址
enum API {
  LOGIN = "/admin/acl/index/login",
  USERINFO = "/admin/acl/index/info",
  LOGOUT = "/admin/acl/index/logout",
}

// 登录
export const reqLogin = (data: ILoginParams) =>
  request.post<any, ILoginData>(API.LOGIN, data);

// 获取用户数据
export const reqUserInfo = () => request.get<any, IUserInfo>(API.USERINFO);

// 退出登录
export const reqLogout = () => request.post<any, any>(API.LOGOUT);
